package server_common

import (
	"context"
	"grpc_demo/internal/controller"
	"grpc_demo/pkg/logger"
	pb "grpc_demo/proto_gen"
)

func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloResponse, error) {
	logger.WithContext(ctx).Infof("Received: %v", in.GetName())
	return &pb.HelloResponse{Message: "Hello " + in.GetName()}, nil
}

func (s *server) Login(ctx context.Context, in *pb.LoginRequest) (*pb.LoginResponse, error) {
	logger.WithContext(ctx).Info("Login Req")
	return controller.LoginController(ctx, in)
}
